<?php
/**
 * 后台基础公共类
 */
namespace app\hotback\controller;
use think\Controller;
class Base extends Controller
{
	// 管理员
	protected $admin;
	public function _initialize()
	{
		// 管理员信息
		$admin = session('admin');
		$this->admin = $admin;
	}

	/**
	 * IsLogin 登录校验
	 */
	 
	protected function IsLogin()
	{
		if(empty($this->admin))
		{
			if(request()->isPost())
			{
				exit(json_encode(['code' => -400, 'msg' => '登录失效，请重新登录']));
			}else
			{
				$this->redirect('Publics/login');
			}
		}
	}
	
}